﻿using System.Collections.Generic;
using System.Xml.Serialization;
/******************************************************************************************************************
 * 
 * 
 * 说　明： SqlMap(版本：Version1.0.0)
 * 作　者：李朝强
 * 日　期：2015/05/19
 * 修　改：
 * 参　考：http://my.oschina.net/lichaoqiang/
 * 备　注：暂无...
 * 
 * 
 * ***************************************************************************************************************/
namespace SQLMap.Core
{

    /// <summary>
    /// <![CDATA[SqlMap]]>
    /// </summary>
    [XmlType(TypeName = "sqlMap", Namespace = "http://www.lichaoqiang.com/2015/05/sqlMap")]
    [XmlRoot(Namespace = "http://www.lichaoqiang.com/2015/05/sqlMap")]
    public sealed class SqlMap
    {
        /// <summary>
        ///<![CDATA[Command列表]]>
        /// </summary>
        [XmlArray("commandList")]
        public List<Command> CommandList
        {
            get;
            set;
        }


        /// <summary>
        ///<![CDATA[根据Name，获取CommandInfor对象]]>
        /// </summary>
        /// <param name="Name"><![CDATA[sqlname]]></param>
        /// <returns></returns>
        public Command this[string sqlId]
        {
            get
            {
                return (Command)SqlMapConfig.mapConfigProvider.GetCommandFromSqlMapById(sqlId: sqlId);
            }
        }
    }
}